<template>
  <div class="email-group">
    <div class="email-group-content">
      <div class="email-group-logo">
        <img src="../../../../assets/img/login_icon.png" alt="">
      </div>
      <div class="email-group-text">
        {{$route.query.approval === '1' ? 'You have approved the group member application' : 'You have rejected the group member request'}}
      </div>
      <div class="email-group-btn" @click="jump">OK</div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'applyEmailGroup',
  data () {
    return {}
  },
  methods: {
    jump () {
      this.$router.replace('/')
    },
    async ok () {
      const params = {
        approval: this.$route.query.approval,
        userId: this.$route.query.userId,
        groupId: this.$route.query.groupId
      }
      const { approvalPeerGroup } = this.$interface.system
      const { data } = await approvalPeerGroup(params)
      if (data.code === 0) {
        this.$message.success('Success')
      } else {
        this.$message.error(data.msg)
      }
    }
  },
  created () {
    this.ok()
  }
}
</script>

<style scoped lang="scss">
.email-group{
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #F2F4F8FF;
  &-content {
    width: 500px;
    height: 600px;
    background: #fff;
    padding: 60px 30px;
  }
  &-logo{
    img {
      width: 100%;
      height: auto;
      min-width: 197px;
    }
  }
  &-text {
    font-size: 18px;
    font-weight: bold;
    margin-top: 30px;
  }
  &-btn {
    margin-top: 350px;
    text-align: center;
    font-size: 14px;
    color: #FFFFFF;
    height: 40px;
    line-height: 40px;
    background: #0043CE;
    border-radius: 2px 2px 2px 2px;
    cursor: pointer;
  }
}
</style>
